<?php
require_once(dirname(__FILE__).'/config.php');
CheckRank(0,0);
$menutype_son = 'ref';
require_once(DEDEINC.'/datalistcp.class.php');
setcookie('ENV_GOBACK_URL', GetCurUrl(), time()+3600, '/');
if(!isset($dopost)) $dopost = '';
if($dopost=='')
{
    $query = "Select * From `#@__member_paylist` where mid='".$cfg_ml->M_ID."' order by id desc";
    $dlist = new DataListCP();
    $dlist->pageSize = 20;
    $dlist->SetTemplate(DEDEMEMBER.'/templets/tixian.htm');
    $dlist->SetSource($query);
    $dlist->Display();
}
elseif ($dopost=='sq')
{
	$sqmoney = trim($sqmoney);
	$tips = HtmlReplace($tips, 1);
	if(MyDate('j',time()) < 31)
	{
	if($sqmoney > GetMemberInfos(money,$cfg_ml->M_ID))
	{
            ShowMsg('亲，你暂时木有这么多钱可提哦！', '-1');
            exit();
	}
	if(GetMemberInfos(money,$cfg_ml->M_ID) < 2000)
	{
		ShowMsg('亲，金币满2000(20元RMB)才可以提现的啦！', '-1');
		exit();
	}
	if($sqmoney < 2000)
	{
	ShowMsg('亲，每次提现不能少于2000金币！', '-1');
		exit();
	}
	else{
	$dsql->ExecuteNoneQuery("INSERT INTO `#@__member_paylist`(mid,money,tips,paytime,sta,xingming,zhifubao) VALUES ('".$cfg_ml->M_ID."','$sqmoney','$tips','".time()."',0,'$xingming','$zhifubao');");
	ShowMsg('申请提现成功，请等待管理员处理！', '-1');
            exit();
	}
	}
	else{
		ShowMsg('亲，每个月1-5号才可以提现哦！', '-1');
		exit();
		}
}